package judgeSquareSum

func judgeSquareSum(c int) bool {
	var tmp int = c / 2
	var high int = c

	i := 0
	for {

		if tmp*tmp < c {

			for {
				tmp++
				if i*i+tmp*tmp == c {
					return true
				}
				if i*i+tmp*tmp > c {
					high = tmp
					continue
				}
			}
		}
		i++
		if i == high 
		
	}
}
